import * as allIcons from '@ant-design/icons';
import React from 'react';

// 展示菜单图标
const showMenuIcon = (icon: string, iconType = 'Outlined') => {
    // console.log(icon)
    if(icon){
        let fixIconName = icon.slice(0, 1).toLocaleUpperCase() + icon.slice(1) + iconType;
        return React.createElement(allIcons[fixIconName] || allIcons[icon]);
    }else{
        return "";
    }
  
};

export default showMenuIcon;
